﻿<Controls:MetroWindow x:Class="FR.SAFTAnalyser.Views.SettingsView"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                      xmlns:meffed="http:\\www.codeplex.com\MEFedMVVM"
                      meffed:ViewModelLocator.ViewModel="SettingsViewModel"
                      Title="Opções" MinHeight="200" MinWidth="200" ResizeMode="CanResizeWithGrip" ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="80" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock Text="Ficheiro SAFT:" Grid.Column="0"  Grid.Row="0" Margin="3"/>
        <TextBlock Text="Chave pública:" Grid.Column="0"  Grid.Row="1" Margin="3"/>
        <TextBlock Text="Chave privada:" Grid.Column="0"  Grid.Row="2" Margin="3"/>
        <TextBlock Text="Versão Schema:" Grid.Column="0"  Grid.Row="4" Margin="3"/>
        <TextBlock Text="Data mínima documentos" Grid.Column="0"  Grid.Row="5" Margin="3"/>
        
        <TextBlock Text="{Binding SAFTFileName, Mode=TwoWay}" Grid.Column="1"  Grid.Row="0" Margin="3"/>
        <TextBlock Text="{Binding PublicKeyFileName, Mode=TwoWay}" Grid.Column="1"  Grid.Row="1" Margin="3"/>
        <TextBlock Text="{Binding PrivateKeyFileName, Mode=TwoWay}" Grid.Column="1"  Grid.Row="2" Margin="3"/>
        <ComboBox SelectedIndex="{Binding SchemaVersion, Mode=TwoWay}" Grid.Column="1"  Grid.Row="4" Grid.ColumnSpan="2" Margin="3,3,10,3"
                  IsSynchronizedWithCurrentItem="True">
            <ComboBoxItem Content="SAFTPT_1_01" />
        </ComboBox>
        
        <Button Content="..." Command="{Binding DoOpenSaftFileCommand}" Grid.Row="0" Grid.Column="2" Margin="3" Width="50" />
        <Button Content="..." Command="{Binding DoOpenPublicKeyFileCommand}" Grid.Row="1" Grid.Column="2" Margin="3" Width="50"/>
        <Button Content="..." Command="{Binding DoOpenPublicKeyFileCommand}" Grid.Row="2" Grid.Column="2" Margin="3" Width="50"/>

        <Controls:ToggleSwitch Header="Abrir ficheiros automáticamente" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="3,3,10,3"
                               IsChecked="{Binding RememberLastOpenFiles, Mode=TwoWay}"/>

        <DatePicker Grid.Row="5" Grid.Column="1" Margin="3" Grid.ColumnSpan="2"
                    SelectedDate="{Binding DataMinima}" />

        <Button Command="{Binding DoSaveSettingsCommand}" Content="Guardar" Grid.Column="2" Grid.Row="6" Margin="10" Padding="3" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
    </Grid>
</Controls:MetroWindow>
